<HTML>
<HEAD>
<title>Serializer.isTrusted - </title>
<link rel="stylesheet" href="../../style.css">
</HEAD>
<BODY>
<a href="../index.html">org.mapdb</a>&nbsp;/&nbsp;<a href="index.html">Serializer</a>&nbsp;/&nbsp;<a href=".">isTrusted</a><br/>
<br/>
<h1>isTrusted</h1>
<a name="org.mapdb.Serializer$isTrusted()"></a>
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">isTrusted</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code><br/>
<p>Returns if this Serializer is trusted to always read the same number of bytes as it writes for any given object being serialized/de-serialized. <p> MapDB has a relaxed record size boundary checking. It expects deserializers to read exactly as many bytes as were written during serialization. If a deserializer reads more bytes than it wrote, it might start reading others record data in store. </p>
<p> Some serializers (Kryo) have problems with this. To prevent this, we can not read data directly from a store, but we must copy them into separate <code>byte[]</code> buffers. Thus, zero-copy optimizations are disabled by default, but can be explicitly enabled here by letting this method return <code>true</code>. </p>
<p> This flag indicates if this serializer was 'verified' to read as many bytes as it writes. It should also be much better tested etc. </p>
</p>
<p><strong>Return</strong><br/>
if this Serializer is trusted to always read the same number of bytes as it writes for any given object being serialized/de-serialized</p>
<br/>
<br/>
</BODY>
</HTML>
